Skip to contentSkip to conversation

Change in openvpn[master]: multi-socket: do not return tuntap flags on server-side

Openvpn-devel In review its_Giaan (Code Review) 2 participants 11 messages Nov 11, 2025 – Nov 24, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1762862118000.I6a5110a0583b8b33496b06d9c27c1084df38e842@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email

to review the following change.

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

multi-socket: do not return tuntap flags on server-side

Tuntap flags are already handled within
multi_io_process_io() so return them by
multi_io_process_flags() would be redoundant,
since we need them only for tun_set().

While at it, removed part of the I/O process
from multi_process_io_udp() since those are
also handled within multi_io_process_io().

Change-Id I6a5110a0583b8b33496b06d9c27c1084df38e842

---
M src/openvpn/forward.c
M src/openvpn/mudp.c

2 files changed, 3 insertions(+), 57 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/1

src/openvpn/forward.c +3 -3
index c355f66..211cdc8 100644
@@ -2158,10 +2158,10 @@
 void
 get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
 {
-    unsigned int out_socket, out_tuntap;
+    unsigned int out_socket;
 
-    multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tuntap);
-    multi_io->udp_flags = out_socket | out_tuntap;
+    multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL);
+    multi_io->udp_flags = (out_socket << SOCKET_SHIFT);
 }
 
 void
src/openvpn/mudp.c +0 -54

74 lines not on this page · raw message

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, its_Giaan, plaisthos.

cron2 has posted comments on this change by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email )

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

Patch Set 1: Code-Review-1

(1 comment)

Patchset:

PS1:
I do not understand anything of this :-( - so we should look at this together, and you explain to me what happens where...

I did *test* it (t_client/t_server) and that part still works, so generally it's not introducing breakage ;-) - but to feel comfortable +2'ing it, I need to understand it better.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sun, 16 Nov 2025 12:45:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, its_Giaan, plaisthos.

Hello cron2, flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review-1 by cron2

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

multi-socket: do not return tuntap flags on server-side

Tuntap flags are already handled within
multi_io_process_io() so return them by
multi_io_process_flags() would be redoundant,
since we need them only for tun_set().

While at it, removed part of the I/O process
from multi_process_io_udp() since those are
also handled within multi_io_process_io(),
and changed the IO debug to a more useful
style.

Change-Id I6a5110a0583b8b33496b06d9c27c1084df38e842

---
M src/openvpn/forward.c
M src/openvpn/mudp.c

2 files changed, 5 insertions(+), 71 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/2

src/openvpn/forward.c +3 -3
index f01fb4c..d57cbe0 100644
@@ -2170,10 +2170,10 @@
 void
 get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
 {
-    unsigned int out_socket, out_tuntap;
+    unsigned int out_socket;
 
-    multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tuntap);
-    multi_io->udp_flags = out_socket | out_tuntap;
+    multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL);
+    multi_io->udp_flags = (out_socket << SOCKET_SHIFT);
 }
 
 void
src/openvpn/mudp.c +2 -68

90 lines not on this page · raw message

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, plaisthos.

its_Giaan has posted comments on this change by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email )

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

Patch Set 2:

(1 comment)

Patchset:

PS1:

Quoted 1 line

I do not understand anything of this :-( - so we should look at this together, and you explain to me […]

We discussed this on IRC

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 20 Nov 2025 10:58:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>

#5 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, its_Giaan, plaisthos.

cron2 has posted comments on this change by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email )

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

Patch Set 2:

(1 comment)

Patchset:

PS2:
IRC notes...

```
18:10 <@cron2> okay
18:10 <@cron2> - drop the #ifdef MULTI_DEBUG_EVENT_LOOP (completely)
18:10 <@cron2> - add the comment :-)
18:10 <@cron2> - drop FILE_CLOSED, plus explain in the commit message
18:10 <@cron2> - drop the new msg() again, because, too excessive
18:11 <@cron2> and someone needs to explain get_io_flags_dowork_udp() to me
18:11 <@cron2> why is it called "udp" and the comment says "for TCP & UDP
               sockets"?
18:13 <@cron2> and why does it say "Wait for I/O events" when all it does (does
               it?) is set up the flags for events we want to see?
18:14 < Giaan> probably a copy paste from it´s ancestor (io_wait())
18:15 <@cron2> should TUN_WRITE then also be removed from get_io_flags_udp()?
18:15 < Giaan> no
18:15 < Giaan> we need that for tun_set()
18:17 <@cron2> do I even dare to ask how tun_set() and get_io_flags_udp() 
               relate, and why get_io_flags_udp() would deal with TUN_WRITE
               while get_io_flags_dowork_udp() does not?
18:17 < Giaan> ah indeed
18:17  * cron2 has to leave, and fetch the kids from sports... so will be back
          tomorrow and work on this...
18:17 < Giaan> it´s related to the get_io_flags_dowork_udp()
18:18 <@cron2> (can we get rid of get_io_flags_dowork_udp()?)
18:18 <@cron2> just fold these two lines into the caller... this used to be
               much larger
18:18 < Giaan> yeah, and then all the udp sockets won´t work :D
18:19 <@cron2> nah, keep the logic, but put it into get_io_flags_udp() instead
               of having an extra function for just one extra function call + 1
               assignment :-)
18:19 <@cron2> anyway, will be back...
18:20 < Giaan> please dump all your concerns in gerrit so we won´t forget :-)
```

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 21 Nov 2025 21:03:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

#6 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, its_Giaan, plaisthos.

Hello cron2, flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email

to look at the new patch set (#3).

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

multi-socket: do not return tuntap flags on server-side

Tuntap flags are already handled within
multi_io_process_io() so return them by
multi_io_process_flags() would be redoundant,
since we need them only for tun_set().

While at it, removed part of the I/O process
from multi_process_io_udp() since those are
also handled within multi_io_process_io(),
removed the FILE_CLOSED and FILE_SHIFT
defines since we now handle that kind of
event in multi_io_process_io() through
the MULTI_IO_FILE_CLOSE_WRITE define.

Change-Id I6a5110a0583b8b33496b06d9c27c1084df38e842

---
M src/openvpn/event.h
M src/openvpn/forward.c
M src/openvpn/mudp.c

3 files changed, 4 insertions(+), 74 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/3

src/openvpn/event.h +0 -2
index f6aa9c4..c2c63f6 100644
@@ -68,8 +68,6 @@
 #define MANAGEMENT_SHIFT 6
 #define MANAGEMENT_READ  (1 << (MANAGEMENT_SHIFT + READ_SHIFT))
 #define MANAGEMENT_WRITE (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))
-#define FILE_SHIFT       8
-#define FILE_CLOSED      (1 << (FILE_SHIFT + READ_SHIFT))
 #define DCO_SHIFT        10
 #define DCO_READ         (1 << (DCO_SHIFT + READ_SHIFT))
 #define DCO_WRITE        (1 << (DCO_SHIFT + WRITE_SHIFT))
src/openvpn/forward.c +3 -3
index a6d3394..ccb8404 100644
@@ -2170,10 +2170,10 @@
 void
 get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
 {
-    unsigned int out_socket, out_tuntap;
+    unsigned int out_socket;
 
-    multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tuntap);
-    multi_io->udp_flags = out_socket | out_tuntap;
+    multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL);
+    multi_io->udp_flags = (out_socket << SOCKET_SHIFT);
 }
 
 void
src/openvpn/mudp.c +1 -69

93 lines not on this page · raw message

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 3
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#7 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, its_Giaan, plaisthos.

cron2 has posted comments on this change by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email )

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

Patch Set 3: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 3
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 24 Nov 2025 17:58:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#8 lore raw

PATCH v3 1/1 multi-socket: do not return tuntap flags on server-side

In reply to a message not in the archive

From: Gianmarco De Gregori <[email protected]...>

Tuntap flags are already handled within
multi_io_process_io() so return them by
multi_io_process_flags() would be redoundant,
since we need them only for tun_set().

While at it, removed part of the I/O process
from multi_process_io_udp() since those are
also handled within multi_io_process_io(),
removed the FILE_CLOSED and FILE_SHIFT
defines since we now handle that kind of
event in multi_io_process_io() through
the MULTI_IO_FILE_CLOSE_WRITE define.

Change-Id I6a5110a0583b8b33496b06d9c27c1084df38e842

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1364
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1364
This mail reflects revision 3 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/event.h +0 -2
index f6aa9c4..c2c63f6 100644
@@ -68,8 +68,6 @@
 #define MANAGEMENT_SHIFT 6
 #define MANAGEMENT_READ  (1 << (MANAGEMENT_SHIFT + READ_SHIFT))
 #define MANAGEMENT_WRITE (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))
-#define FILE_SHIFT       8
-#define FILE_CLOSED      (1 << (FILE_SHIFT + READ_SHIFT))
 #define DCO_SHIFT        10
 #define DCO_READ         (1 << (DCO_SHIFT + READ_SHIFT))
 #define DCO_WRITE        (1 << (DCO_SHIFT + WRITE_SHIFT))
src/openvpn/forward.c +3 -3
index a6d3394..ccb8404 100644
@@ -2170,10 +2170,10 @@
 void
 get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
 {
-    unsigned int out_socket, out_tuntap;
+    unsigned int out_socket;
 
-    multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tuntap);
-    multi_io->udp_flags = out_socket | out_tuntap;
+    multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL);
+    multi_io->udp_flags = (out_socket << SOCKET_SHIFT);
 }
 
 void
src/openvpn/mudp.c +1 -69

93 lines not on this page · raw message

#9 lore raw

[Openvpn-devel] [PATCH applied] Re: multi-socket: do not return tuntap flags on server-side

So we discused this at length on IRC (and in gerrit). I'm still not sure if I grok all the intricacies involved here, but some of the changes are very obvious because the way "non udp socket events" have changed in the multisocket patch makes the code in mudp.c obsolete now - others not so much, but master + this passes all client/server tests, with single and multisocket, and async scripts, so I guess all events are still being properly addressed...

I would have gotten rid of get_io_flags_dowork_udp() at the same time (just include the 2-3 lines in the single caller...), but this can be done another time.

Same for the odd indent at the end of multi_io_process_io()...

Your patch has been applied to the master branch.

commit 6244e466217a367dd4d858f5e930e3aab415fc42

Author: Gianmarco De Gregori
Date:   Mon Nov 24 18:58:27 2025 +0100
     multi-socket: do not return tuntap flags on server-side

     Signed-off-by: Gianmarco De Gregori <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1364
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg34650.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#10 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#4) to the change originally created by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

multi-socket: do not return tuntap flags on server-side

Tuntap flags are already handled within
multi_io_process_io() so return them by
multi_io_process_flags() would be redoundant,
since we need them only for tun_set().

While at it, removed part of the I/O process
from multi_process_io_udp() since those are
also handled within multi_io_process_io(),
removed the FILE_CLOSED and FILE_SHIFT
defines since we now handle that kind of
event in multi_io_process_io() through
the MULTI_IO_FILE_CLOSE_WRITE define.

Change-Id I6a5110a0583b8b33496b06d9c27c1084df38e842

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1364
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34650.html

---
M src/openvpn/event.h
M src/openvpn/forward.c
M src/openvpn/mudp.c

3 files changed, 4 insertions(+), 74 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/4

src/openvpn/event.h +0 -2
index f6aa9c4..c2c63f6 100644
@@ -68,8 +68,6 @@
 #define MANAGEMENT_SHIFT 6
 #define MANAGEMENT_READ  (1 << (MANAGEMENT_SHIFT + READ_SHIFT))
 #define MANAGEMENT_WRITE (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))
-#define FILE_SHIFT       8
-#define FILE_CLOSED      (1 << (FILE_SHIFT + READ_SHIFT))
 #define DCO_SHIFT        10
 #define DCO_READ         (1 << (DCO_SHIFT + READ_SHIFT))
 #define DCO_WRITE        (1 << (DCO_SHIFT + WRITE_SHIFT))
src/openvpn/forward.c +3 -3
index a6d3394..ccb8404 100644
@@ -2170,10 +2170,10 @@
 void
 get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
 {
-    unsigned int out_socket, out_tuntap;
+    unsigned int out_socket;
 
-    multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tuntap);
-    multi_io->udp_flags = out_socket | out_tuntap;
+    multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL);
+    multi_io->udp_flags = (out_socket << SOCKET_SHIFT);
 }
 
 void
src/openvpn/mudp.c +1 -69

93 lines not on this page · raw message

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 4
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#11 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email )

Change subject: multi-socket: do not return tuntap flags on server-side
......................................................................

multi-socket: do not return tuntap flags on server-side

Tuntap flags are already handled within
multi_io_process_io() so return them by
multi_io_process_flags() would be redoundant,
since we need them only for tun_set().

While at it, removed part of the I/O process
from multi_process_io_udp() since those are
also handled within multi_io_process_io(),
removed the FILE_CLOSED and FILE_SHIFT
defines since we now handle that kind of
event in multi_io_process_io() through
the MULTI_IO_FILE_CLOSE_WRITE define.

Change-Id I6a5110a0583b8b33496b06d9c27c1084df38e842

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1364
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34650.html

---
M src/openvpn/event.h
M src/openvpn/forward.c
M src/openvpn/mudp.c

3 files changed, 4 insertions(+), 74 deletions(-)
src/openvpn/event.h +0 -2
index f6aa9c4..c2c63f6 100644
@@ -68,8 +68,6 @@
 #define MANAGEMENT_SHIFT 6
 #define MANAGEMENT_READ  (1 << (MANAGEMENT_SHIFT + READ_SHIFT))
 #define MANAGEMENT_WRITE (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))
-#define FILE_SHIFT       8
-#define FILE_CLOSED      (1 << (FILE_SHIFT + READ_SHIFT))
 #define DCO_SHIFT        10
 #define DCO_READ         (1 << (DCO_SHIFT + READ_SHIFT))
 #define DCO_WRITE        (1 << (DCO_SHIFT + WRITE_SHIFT))
src/openvpn/forward.c +3 -3
index a6d3394..ccb8404 100644
@@ -2170,10 +2170,10 @@
 void
 get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
 {
-    unsigned int out_socket, out_tuntap;
+    unsigned int out_socket;
 
-    multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tuntap);
-    multi_io->udp_flags = out_socket | out_tuntap;
+    multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL);
+    multi_io->udp_flags = (out_socket << SOCKET_SHIFT);
 }
 
 void
src/openvpn/mudp.c +1 -69

93 lines not on this page · raw message

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 4
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>